/*!
 @header    UnitView.h
 @abstract  添加成员animationView
 @author    丁磊
 @version   1.0.0 2014/05/28 Creation
 */

#import <UIKit/UIKit.h>
#import "UnitCell.h"

#define ADDTAG  1021
#define DELTAG  1022
#define DONETAG  1023
#define DELUNABLETAG  1025
@protocol UnitViewDelegate<NSObject>

// 通知cell被点击，执行删除操作
- (void) extendCellTouched:(UnitCell *)unitCell;
- (void) unitDoneTouched:(id)sender;
@end

@interface UnitView : UIView


/*
 @abstract 用于显示成员
 */

@property (nonatomic, strong) UIScrollView   *scrollView;

/*
 @abstract 用于管理成员
 */
@property (nonatomic, strong) NSMutableArray *unitList;

/*
 @abstract 默认显示的占位图
 */
@property (nonatomic, strong) UnitCell       *defaultUnit;

/*
 @abstract 默认显示的占位图
 */
@property (nonatomic, strong) UnitCell       *addUnit;

/*
 @abstract 默认显示的占位图
 */
@property (nonatomic, strong) UnitCell       *delUnit;


/*
 @abstract 判断是否有删除操作
 */
@property (nonatomic, assign) BOOL           hasDelete;

/*
 @abstract 判断删除操作unitCell的移动方向
 */
@property (nonatomic, assign) BOOL           frontMove;

/*
 @abstract 统计删除操作总共移动的次数
 */
@property (nonatomic, assign) int            moveCount;

/*
 @abstract 是否需要默认的添加按钮
 */
@property (nonatomic, assign) BOOL            isAddButton;

/*
 @abstract 是否需要删除按钮
 */
@property (nonatomic, assign) BOOL            isDelButton;

/*
 @abstract 是否需要完成按钮
 */
@property (nonatomic, assign) BOOL            isDoneButton;

//是否可删除
@property (nonatomic, assign) BOOL            isDeleteable;



/*
    添加一个成员
    icon：成员头像
    name：成员名字
 */
- (void) addNewUnit:(NSString *)icon withName:(NSString *)name type:(NSInteger)type;

@property (nonatomic, assign) id<UnitViewDelegate>delegate;

- (void) addNewUnit:(Contact *)contact;
- (void) removeUnit:(Contact *)contact;
- (void) removeAll;
@end
